import java.util.ArrayList;
import java.util.List;

public class Solution2100 {
    public List<Integer> goodDaysToRobBank(int[] security, int time) {
        int cur=0;
        boolean[] l=new boolean[security.length];
        for (int i=0;i<security.length;i++){
            if (i>0 && security[i]<=security[i-1]){
                cur++;
            }else{
                cur=0;
            }
            if (cur>=time){
                l[i]=true;
            }
        }
        boolean[] r=new boolean[security.length];
        cur=0;
        for (int i=security.length-1;i>=0;i--){
            if (i!=security.length-1 && security[i]<=security[i+1]){
                cur++;
            }else{
                cur=0;
            }
            if (cur>=time){
                r[i]=true;
            }
        }
        List<Integer> list=new ArrayList<>();
        for (int i=0;i<security.length;i++){
            if (l[i]&&r[i]){
                list.add(i);
            }
        }
        return list;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2100().goodDaysToRobBank(new int[]{5,3,3,3,5,6,2},2));
    }
}
